package com.sfh.sfhshopweb.controller;

import cn.hutool.core.util.IdUtil;
import com.sfh.sfhshopweb.dto.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/tools")
@Api(tags = "工具类控制器")
public class ToolsController {

    //发号机
    @RequestMapping(value = "/getSnowflakeId", method = RequestMethod.GET)
    @ApiModelProperty(value = "获取雪花算法ID")
    public ResponseResult<String> getSnowflakeId() {
        return ResponseResult.success(IdUtil.getSnowflakeNextIdStr());
    }
}
